<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>
    <link rel='stylesheet' href='/stylesheets/login.css' />
    <script src="/javascripts/jquery.js" charset="utf-8"></script>
    <script type="text/javascript">
      $(document).ready(function() {
        // do stuff when DOM is ready
        $("#loginbutton").click(function(){
          $.post(window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+$('#loginform').serialize(),function(data){
            console.log(data);
            if(data.code==-1){
              alert(data.error.msg);
            }else {
              //alert(data.success.msg);
              location.href='http://'+window.location.host+"/invite/users";
            }

          });
        });

      });
      </script>
  </head>
  <body>
    <h1 class="title"><%= title %></h1>

  <div class="content">
    <form id="loginform">
    <div class="item">
      <div>
        用户名
      </div>
      <div>
        <input type="text" name="name"/>
      </div>
    </div>
    <div class="item">
    <div>
      密码
    </div>
    <div>
      <input type="password" name="password"/>
    </div>
    </div>
    </form>
    <div class="item-login">

      <button id="loginbutton">登陆</button>

      </div>
  </div>

  </body>
</html>
